/// @description 销毁事件
// You can write your code in this editor
show_debug_message("Destroy" + string(id));

//断开父view
if(view_parent!=noone)
{
	var pos = ds_list_find_index(view_parent.view_child_list, id);
	ds_list_delete(view_parent.view_child_list, pos);
}

//销毁子view
var size = ds_list_size(view_child_list);
for(var i=0;i<size;i++)
{
	var _child = ds_list_find_value(view_child_list, i);
	instance_destroy(_child);
}

//销毁surface
surface_free(view_surface);

